<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * 
 * @return type Yii::app() 
 * 
 */
function App() {
    return Yii::app();
}

/**
 * 
 * @param type $route
 * @param type $params
 * @param type $ampersand
 * @return type URL
 * 
 */
function CreateUrl($route, $params = array(), $ampersand = '&') {
    return App()->createUrl($route, $params, $ampersand);
}

function Param($name) {
    return App()->params[$name];
}

/**
 * 
 * @return type BASE_URL
 */
function BaseUrl() {
    return App()->baseUrl;
}

/**
 * @return type /public
 */
function PublicUrl(){
    return BaseUrl().'/public';
}

function ThemaUrl(){
    return Yii::app()->theme->baseUrl;
}


/**
 * 
 * @return type BASE_PATH
 */
function BasePath() {
    return App()->basePath;
}

/**
 * 
 * @param type $name
 * @param type $default
 * @return type $_POST
 */
function POST($name = '', $default = NULL) {
    return App()->request->getPost($name, $default);
}

/**
 * 
 * @param type $name
 * @param type $default
 * @return type $_GET
 */
function GET($name = '', $default = NULL) {
    return App()->request->getQuery($name, $default);
}

/**
 * 
 * @param type $name
 * @param type $default
 * @return type $_REQUEST
 */
function REQUEST($name, $default = NULL) {
    return App()->request->getParam($name, $default);
}
